package mediaCoreLib.testing
{
	import flash.events.MouseEvent;
	
	import mx.controls.Button;
	import mx.effects.Glow;

	public class MediaButton extends Button
	{
		
		private var glow:Glow = new Glow();
		private var glowInner:Glow = new Glow();
		
		public function MediaButton()
		{
			super();
			
			// setup effects
			glow.duration = 200;
			glowInner.duration = 20;
			glowInner.inner = true;
		}
		
		override protected function rollOutHandler(event:MouseEvent):void
		{
			glow.isPlaying ? glow.reverse() : glow.play([event.target]);
		}		
		
		override protected function rollOverHandler(event:MouseEvent):void
		{
			glow.play([event.target],true);
		}
		
		override protected function mouseUpHandler(event:MouseEvent):void
		{
			glowInner.isPlaying ? glowInner.reverse() : glowInner.play([event.target])
		}
		
		override protected function mouseDownHandler(event:MouseEvent):void
		{
			glowInner.play([event.target], true);
		}
	}
}